var AddFavorite={
Show:function(LinkId,Type)
	{
	if(LinkId)
		{
		CreateFavorite.Show(0);
		LoadAjax.Get(fastCSharp.ThisFunction(this,this.OnGet,[LinkId,Type]),'/include/linkFavorite.html',{linkId:this.LinkId=LinkId,type:this.Type=Type});
		}
	else	fastCSharp.FloatCenters.addFavorite.Hide();
	},
OnGet:function(Value,LinkId,Type)
	{
	if(Type==this.Type)
		{
		this.LinkId=LinkId;
		Value.typeName=diantou.favorite.TypeNames[this.Type];
		this.Favorites=Value.favorites;
		fastCSharp.Skins.addFavorite.Show(Value);
		fastCSharp.FloatCenters.addFavorite.Show();
		}
	},
Add:function(Id,IsFavorite,ViewId)
	{
	LoadAjax.Post(fastCSharp.ThisFunction(this,this.OnFavorite,[fastCSharp.ViewObjects[ViewId],IsFavorite?-1:1]),IsFavorite?'favorite.Remove':'favorite.Append',{value:{FavoriteId:Id,LinkId:this.LinkId}});
	},
OnFavorite:function(Value,View,Count)
	{
	if(Value.__AJAXRETURN__)
		{
		View.SkinValue.Favorite.LinkCount+=Count;
		View.IsFavorite.Set(Count>0);
		}
	},
ShowCreate:function()
	{
	fastCSharp.FloatCenters.addFavorite.Hide();
	CreateFavorite.OnClose=fastCSharp.ThisFunction(this,this.OnCreate);
	CreateFavorite.Show(1,this.Type);
	},
OnCreate:function(Favorite)
	{
	CreateFavorite.OnClose=null;
	if(Favorite)
		{
		this.Favorites.push({Favorite:Favorite,IsFavorite:0});
		Favorite.LinkCount=Favorite.FocusCount=0;
		}
	this.OnGet({favorites:this.Favorites},this.LinkId,this.Type);
	}
		};